﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using WJ.Infrastructure.Web;
using Plugin.Factory;

namespace NetworkDiskHelper.Web.Controllers
{
    public class NetworkDiskHelperApiController : ApiController
    {
        [HttpPost]
        public List<ResultMsg> GetDownloadLink(Model model)
        {

            List<ResultMsg> linkList = new List<ResultMsg>();

            if (model == null || string.IsNullOrEmpty(model.userPost))
            {
                return linkList;
            }

            foreach (var obj in Plugin.Factory.ObjectFactory.GetObjectList)
            {
                linkList.AddRange(obj.GetDownloadLink(model.userPost));   
            }

            return linkList;
        }

       
    }

   public class Model
    {
        public string userPost { get; set; }
    }
}
